<%@page contentType="text/html" pageEncoding="UTF-8" import="Modelo.*, java.util.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import = "java.util.*" %>
<%@page import = "Modelo.*" %>
<%@page import = "javax.swing.*" %>

<jsp:useBean id="proyecto" scope="request" class="Modelo.Proyecto" />
<%
//esto es para que no guarde en el cache la pagina
            response.setHeader("Cache-Control", "max-age=0");
            response.setHeader("Cache-Control", "no-cache");
            response.setHeader("Cache-Control", "no-store");
            response.setHeader("Pragma", "no-cache");
            response.setDateHeader("Expires", -1);
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Autoevaluacion</title>
       <link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css" media="screen" />
        <link type="text/css" href="<%=request.getContextPath()%>/jQuery/css/custom-theme/jquery-ui-1.8.4.custom.css" rel="Stylesheet" />
        <script type="text/javascript" src="<%=request.getContextPath()%>/jQuery/js/jquery-1.3.2.min.js"></script>
        <script type="text/javascript" src="<%=request.getContextPath()%>/jQuery/js/jquery-ui-1.7.2.custom.min.js"></script>
        <style type="text/css" title="currentStyle">
            @import "<%=request.getContextPath()%>/jQuery/DataTables-1.7.1/media/css/demo_page.css";
            @import "<%=request.getContextPath()%>/jQuery/DataTables-1.7.1/media/css/demo_table_jui.css";
            @import "<%=request.getContextPath()%>/jQuery/DataTables-1.7.1/examples/examples_support/themes/smoothness/jquery-ui-1.7.2.custom.css";
        </style>
        <script type="text/javascript" language="javascript" src="<%=request.getContextPath()%>/jQuery/DataTables-1.7.1/media/js/jquery.js"></script>
        <script type="text/javascript" language="javascript" src="<%=request.getContextPath()%>/jQuery/DataTables-1.7.1/media/js/jquery.dataTables.js"></script>
        <script type="text/javascript" charset="utf-8">
            $(document).ready(function() {
                oTable = $('#table').dataTable({
                    "bJQueryUI": true,
                    "sPaginationType": "full_numbers"
                });
            } );
        </script>
    </head>

    <body>
        <%
                    HttpSession s = request.getSession();
                    if (s.getAttribute("logged") != null && s.getAttribute("logged").equals(true)) {
                        Representante rrr = (Representante) s.getAttribute("representante");
        %>


        <div style="height: 400px">
            <%
                                    String idfactor = (String) request.getParameter("idf");
                                    Factor f = new Factor().findFactor(Long.parseLong(idfactor));

            %>
            <div align="right"  style="width: 640px; position: fixed; text-align: right"  >
                <a href="<%=request.getContextPath()%>/factor/crear.jsp"><img src="<%=request.getContextPath()%>/images/new.png"  style="border:0" alt="Crear"/></a>
                <a href="<%=request.getContextPath()%>/factor/editar.jsp?idf=<%=f.getId()%>"><img src="<%=request.getContextPath()%>/images/edit.png"  style="border:0" alt="Crear"/></a>
                <a href="<%=request.getContextPath()%>/factor/mostrar.jsp"><img src="<%=request.getContextPath()%>/images/list.png"  style="border:0" alt="Ver"/></a>
            </div>
            <p><h3>detalle del  Factor</h3></p>
        <table border="0" class="form">
            <tbody>
                <tr>
                    <td> <p>nombre: </p></td>
                    <td> <input type="text" name="nombre" disabled value="<%=f.getNombre()%>" /></td>
                </tr>
                <tr>
                    <td><p>descripcion: </p> </td>
                    <td> <input type="text" disabled name="descripcion" value="<%=f.getDescripcion()%>" /></td>
                </tr>

            </tbody>
        </table>
        <p><h3>Caracteristicas Asociadas</h3></p>
    <!-- tabla-->
    <%                       Caracteristica c = new Caracteristica();
                            List l = f.getCaracteristica();
                            if (l.size() != 0) {
    %>
    <table cellpadding="0" cellspacing="0" border="0" class="display" id="table">
        <thead>
            <tr>
                <th>nombre</th>
                <th>descripcion</th>
            </tr>
        </thead>
        <tbody>
            <%


                                            Iterator it = l.iterator();
                                            while (it.hasNext()) {
                                                c = (Caracteristica) it.next();
            %>
            <tr>
                <td><%=c.getNombre()%></td>
                <td><%=c.getDescripcion()%></td>
            </tr>

            <%
                                            }
            %>
        </tbody>
    </table>
    <%
                                } else {
    %>
    <h6> No Existen Caracteristicas Asignadas </h6>


    <%                                                            }
    %>
  
</div>

<%} else {
                response.sendRedirect(request.getContextPath() + "/index.jsp");
            }%>
</body>
</html>

</html>
